Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure version.cpp at build time if git repo #618

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

kazarmy
Copy link
Contributor

@kazarmy kazarmy commented Oct 26, 2024

As per #610 (comment), this PR makes the version.cpp.in transformation happen at build time rather than configure time if the Vampire source folder is from git (i.e. there is a proper .git subdirectory), thus ensuring that the git version number in vampire ‑‑version is always updated even if one forgets to do cmake .. before make.

I think I have tested this comprehensively, but there might be a sequence of:

  1. moving the git HEAD commit; and/or
  2. cmake ..; and/or
  3. make

that results in unexpected behavior. Please inform me if that's the case!

References:

  1. https://cmake.org/pipermail/cmake/2012-May/050227.html for the cmake -P solution.
  2. https://stackoverflow.com/a/43206544 for the add_custom_target solution.

Copy link
Contributor

@MichaelRawson MichaelRawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Thank you for figuring this out and documenting your findings, this is a solid solution.

@MichaelRawson MichaelRawson merged commit e1f554a into vprover:master Oct 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants